
#include <ImportAreaData.h>

#include <Area.h>

ImportAreaData::ImportAreaData(Area* areaptr, std::list< ColorData > colordata, ColorKey* key)	
:Command(CommandType::BLOCKING)
,area(areaptr)
,_colordata(colordata)
,_key(key)
{}

ImportAreaData::~ImportAreaData() 
{}

truth ImportAreaData::Execute()
{
	if( area && !_colordata.empty() && _key && !_key->data.empty() )
	{
		AreaLoader::ImportDataToArea(area,_colordata,*_key);
		delete _key;
	}

	complete = 1;
	return 1;
}